import zhreq from "@/api/axios";
import con from "@/api/axios";

export default {
  /**
   * @description:查询告警模板详细信息
   * @param {Number}  alarmTemplateId
   * @return {Object}
   */
  queryAlarmTemplate(params) {
    return zhreq.get(`/alarmTemplate/query/${params.alarmTemplateId}`);
  },

  /**
   * @description:根据基地跟种养类型查询
   * @param {Number}  organizationNo
   * @param {Number}  plantingTypeId
   * @return {Object}
   */
  queryByOrganizationIdAndType(params) {
    return con.post("v3/modelTenant/environmentMonitor/queryByCondition", params);
  },
  /**
   * @description:添加
   * @param {Number} organizationNo
   * @param {Number} plantingTypeId
   * @param {Array}  advanceWarningIdList
   * @return {Object}
   */
  add(params) {
    return con.post("v3/modelTenant/environmentMonitor/add", params);
  },
  /**
   * @description:删除
   * @param {Array}  varietiesEnvironmentIdList
   * @return {Object}
   */
  del(params) {
    return con.get(`v3/modelTenant/environmentMonitor/delByNo?no=${params}`);
  },
  /**
   * @description:修改
   * @param {Number} organizationNo
   * @param {Number} plantingTypeId
   * @param {Array}  advanceWarningIdList
   * @return {Object}
   */
  edit(params) {
    return con.post("v3/modelTenant/environmentMonitor/edit", params);
  },
  getDataItemtable(params) {
    return con.post("v3/modelTenant/monitorRecord/queryPageByCondition", params);
  },
  getDataByDate(params) {
    return con.post("v3/modelTenant/environmentMonitor/computeCurrent", params);
  }
};
